<?php
require_once 'application/constant/templatName.php';
require_once 'application/library/controller/gcBasicAction.php';
require_once 'application/modules/index/services/index_services_IndexService.php';

/**
 * login_IndexController
 * @author    chenmeng
 * @version   1.0
 * @exclude   作  成  日：2011/04/07
 */
class index_IndexController extends gcBasicAction{
    
    /**
     * objService
     */
    private $objService;

    /**
     * indexAction
     */
    public function indexAction(){
        //用于改密码什么的
        //var_dump(encryptionHelper::encryptionByAes("1"));
        $this->setPageUrlForQRCode();
        $this->pvSetPageInfo();
        $this->pvInitPageInfo();
        $this->gcView->blnModel = true;
        $this->gcView->render(templatName::INDEX);
    }

    private function pvInitPageInfo() {
        $this->objService = new index_services_IndexService();
        $arrResult = $this->objService->pbGetSiteInfo("4");//初始化新闻
        $this->gcView->arrInformation = $arrResult;
    }

    public function changetplAction() {
        $this->objService = new index_services_IndexService();
        $strFg = $this->getParam("fg");
        switch ($strFg) {
            case "2":
                $arrResult = $this->objService->pbGetSiteInfo("1");
                $this->gcView->arrResult = $arrResult;
                $this->gcView->render("companyIntroduce.tpl");
                break;
            case "3":
                $arrResult = $this->objService->pbGetSiteInfo("2");
                $this->gcView->arrResult = $arrResult;
                $this->gcView->render("corporateCulture.tpl");
                break;
            case "4":
                $arrResult = $this->objService->pbGetSiteInfo("3");
                $this->gcView->arrResult = $arrResult;
                $this->gcView->render("developmentStrategy.tpl");
                break;
            case "6":
                $this->gcView->render("connect.tpl");
                break;
        }
    }
    
    public function shownewsAction() {
        $strNewsNo = $this->getParam("newsNo");
        $this->objService = new index_services_IndexService();
        $strNews = $this->objService->pbGetNews($strNewsNo);
        $this->gcView->news = $strNews;
        $this->gcView->render("showNews.tpl");
    }


    /**
     * pvSetPageInfo
     */
    private function pvSetPageInfo(){
        $this->gcView->title            = $this->getLabel("index_companyName");
        $this->gcView->Login_Staff      = $this->getLabel("Login_Staff");
        $this->gcView->Login_Member     = $this->getLabel("Login_Member");
        $this->gcView->Login_Password   = $this->getLabel("Login_Password");
        $this->gcView->Login_Reset      = $this->getLabel("Login_Reset");
        $this->gcView->Login_Notice     = $this->getLabel("Login_Notice");
        $this->gcView->Login_Forget     = $this->getLabel("Login_Forget");
    }
}
